<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var a = 3;
    var b = 1;
    if (a>b) {
        c = a;
        a = b;
        b = c;
    }
    console.log(a);
    console.log(b);

    var arr = [1,3];
    //arr[0];  a
    //arr[1];  b
    if (arr[0]>arr[1]){
        c = arr[0];
        arr[0] = arr[1];
        arr[1] = c;
    }

    console.log(arr);
</script>
</body>
</html>